﻿#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <math.h>

typedef double Real;

typedef struct Point_s
{
	Real x;
	Real y;
}Point;

typedef struct TContext_s
{
	int n;
	char f;
	char v[255];
}TContext;

TContext context;

void read_data(TContext* ctx)
{
	gets(ctx->v);
	ctx->n = strlen(ctx->v);
}

void do_task(TContext* ctx)
{
	int i = 0;
	int n = 0;
	char prev = 0;
	for (i = 0; i < ctx->n; ++i) {
		if (ctx->v[i] == ' ' && (prev != ' ' && i != 0))
			n++;
		prev = ctx->v[i];
	}
	if (prev != ' ')
		n++;
	printf("%d\n", n);
}

void solve(TContext* ctx)
{
	read_data(ctx);
	do_task(ctx);
}

int main()
{
	freopen("D:/Develop/GitRepos/MOOC/浙江大学/数据结构/201906/DataStructure/M2019秋C入门和进阶练习集/7-110.txt", "r", stdin);
	solve(&context);
	return 0;
}
